﻿using Architecture.Api.Application.Commands.DeepProcessingCommand;
using Architecture.Domain.Services.Interface;
using Architecture.Domain.TraceabilityManage;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.DeepProcessingHandler
{
    public class DeepProcessingCorporationQueryCommandHandler : IRequestHandler<DeepProcessingCorporationQueryCommand, Corporation>
    {
        private readonly IDeepProcessingService _deepProcessingService;

        public DeepProcessingCorporationQueryCommandHandler(
            IDeepProcessingService deepProcessingService)
        {
            _deepProcessingService = deepProcessingService;
        }

        public async Task<Corporation> Handle(DeepProcessingCorporationQueryCommand request, CancellationToken cancellationToken)
        {
            return await _deepProcessingService.GetCorporationInfo(request.productionLot, request.DeepProcessingCompanyId);
        }
    }
}